package com.example.sys.express.mapping;

import com.example.core.mapping.BaseMapping;
import com.example.core.utils.StringUtils;
import com.example.core.utils.UserUtils;
import com.example.sys.express.po.SysExpress;
import com.example.sys.express.vo.SysExpressVo;
import org.springframework.stereotype.Service;

@Service
public class SysExpressMapping extends BaseMapping<SysExpress, SysExpressVo> {

    @Override
    public void toPo(SysExpressVo vo, SysExpress po) throws Exception {
        super.toPo(vo, po);
        if (StringUtils.isEmpty(po.getSenderName())) {
            po.setSenderName(UserUtils.getUserName());
        }
    }
}
